home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-13 | 6.3 KB | 201 lines | [TEXT/FOX+] |
-
- plotGraph
-
- DESCRIPTION
-
- plotGraph is an XFCN for generating graphs from within
- FoxBASE+/Mac. It can graph up to 50 data points in a line or bar
- graph, and up to 10 values in a pie chart. Y-Axis values may be
- formatted as "general", currency or percents, and values may be
- automatically scaled, or adjusted to a fixed scale. Fonts and
- styling, background grid, title, X-axis legends, currency symbol
- and currency symbol placement options can also be specified.
-
-
- LIMITATIONS
-
- This initial version only supports graphing integer values. The
- maximum value that can be graphed is 4,294,967,295 (2^32 - 1). It
- doesn't currently support color. The character used to separate
- hundreds from thousands, and thousands from millions, etc. (",")
- can't be specified by the user (it's set as a comma).
-
-
- THE DIRTY PART
-
- There is no charge for personal use of this XFCN. However, if you
- include it in an application for which you are paid to develop
- (e.g., for in-house company use) or for which you charge others
- (e.g., for a client or customer) please send a $20 shareware fee
- to:
-
- Jim Davis
- 414 Chestnut Street
- San Francisco, CA 94133
-
-
- INSTALLATION
-
- Use ResEdit or a similar resource utility to copy XFCN 5000 from
- the file plotGraph. Paste it into your user resource file (e.g.,
- your FoxUser file).
-
-
- USAGE
-
- CALL plotGraph TO result WITH
- numPoints, data1, data2, outerRect, graphRect, ;
- graphOptions, gFont, graphTitle, xAxisLegend, minMaxValue
-
-
- DESCRIPTION OF PARAMETERS
-
- numPoints - number of data points to graph. No check is made to
- compare numPoints with actual number of data points passed, so
- make sure this number is correct. Maximum is 50 for line and bar
- charts, and 10 for pie charts.
-
- outerRect - the outermost enclosing rectangle, passed as a string
- of four 5-digit values (t,l,b,r).
-
- graphRect - enclosing rectangle of graph itself, passed as a
- string of four 5-digit values (t,l,b,r).
-
- data1 - first set of data points, passed as string of 10-digit
- integer values, the first 25.
-
- data2 - second set of data points, passed as string of 10-digit
- integer values, the second 25 (makes for total of 50 data points).
- (Of course, you only pass as many as you need.)
-
- graphOptions -
-
- pos 1: Graph Type:
- 'L' = Line
- 'B' = Bar
- 'P' = Pie
-
- pos 2: Format:
- '$' = currency with commas, negative values display inside ().
- 'G' = commas only
- '%' = as percent
-
- pos 3: Display X-Axis labels for line or bar graphs, or legend box
- for pie graphs:
- 'Y' = display
- any other character = don't display
-
- pos 4: Display Y-axis labels for line and bar graphs, or %age
- labels for pie slices
- 'Y' = display
- any other character = don't display
-
- pos 5: Currency symbol
-
- pos 5: Placement of currency symbol:
- 'B' = before number
- 'A' = after number
-
- pos 6: Scaling option:
- 'A' = auto scaling
- 'F' = fixed scaling
-
- pos 7: Show vertical grid lines:
- 'Y' = show vertical grid lines
- any other character = don't show vertical grid lines
-
- pos 8: Show horizontal grid lines:
- 'Y' = show horizontal grid lines
- any other character = don't show vertical grid lines
-
-
- gFont - Font for Y-Axis and X-Axis legends, passed as
- fontName;fontSize. fontSize uses Fox convention for adding style.
-
- graphTitle - Title for graph (centered at top). Passed as
- title;font;fontSize. fontSize uses Fox convention for adding
- style.
-
- xAxisLegend - legend for X-Axis. If a bar or line graph, passed as
- string of 50 5-character values. If a pie chart, passed as 10 25-
- character values.
-
- minMaxValue - for line and bar graphs, contains a 10 character
- minimum graph value, and 10 character maximum graph value, and a
- 10 character value of the number of steps to show along the Y-
- axis. For auto-scaled line and bar graphs, the minimum and maximum
- graph values are ignored. For pie charts, this contains a single
- value, the width of the legend box.
-
-
- RETURN VALUES:
-
- "0" - No error
- "1" - Wrong number of parameters (must supply 10 parameters)
- "2" - Bad rectangles. graphRect must be enclosed within outerRect
- "3" - The graphRect must be a square (i.e., only round pies!)
- "4" - Too many data points (maximum is 10 for a pie chart, 50 for
- line or bar graph).
-
- See DEMO.PRG for sample usage and a demonstration of the XFCN's
- features.
-
-
- USAGE NOTES AND TIPS:
-
- The graph rectangle must be entirely enclosed within the outer,
- framing rectangle.
-
- Pies charts must have a square graph rectangle.
-
- X-axis labels may overlap if the graph is not wide enough.
- Skipping labels (e.g., showing every other one) is one way around
- this problem if a graph can't be made larger.
-
- If fixed scaling is selected, you must supply a minimum and
- maximum value, or no data will display.
-
- Styles may be combined in your program (e.g., bold + italic),
- although the DEMO.PRG does not demonstrate this. Styles are
- specified as in FoxBASE+/Mac: point size plus 256 for bold, 512
- for italic, and 1024 for underline. Font names must be correctly
- spelled, or the text will default to Chicago.
-
- If advancing from record to record and displaying graphs for each
- displayed record, you will achieve a smoother effect by not
- clearing the screen after displaying the initial graph. Anything
- falling within the outer graph rectangle will be overdrawn.
- However, if graph dimensions are changed, then the screen should
- be cleared.
-
- To workaround the limits of the maximum values, scale the values.
-
-
- USING THE DEMO PROGRAM
-
- DEMO.PRG is basic and straightforward. Some sample data is
- provided for demonstration of graph features, and the code will
- give an example of how to use plotGraph. The "Edit Data" button
- displays the data in an Edit window. The "Edit Labels" displays
- the values used for X-Axis labels and in the pie chart legend.
- Click on "Plot It" to re-draw the graph with currently selected
- parameters. The graph appears on Screen 2. Click "Done" to exit to
- FoxBASE+/Mac. The left and right arrows will back-up or advance
- through the sample data, and re-draw the graph for the new data.
- As an added feature, each time a graph is drawn, it is also saved
- in a picture field in the Sample.DBF file. This demonstrates how
- to capture graphs for later display, or for inclusion in a report.
-
-
- QUESTIONS, COMMENTS, SUGGESTIONS, COMPLAINTS, ETC.
-
- Send e-mail to jdav@well.sf.ca.us (from Compuserve, that would be
- >INTERNET:jdav@well.sf.ca.us).
-
-
- TOOLS:
-
- I used MPW C.
-
- Better late than never!
-